package com.betterjr.modules.application;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.betterjr.common.web.ControllerExceptionHandler;
import com.betterjr.common.web.ControllerExceptionHandler.ExceptionHandler;
import com.betterjr.common.web.Servlets;

@Controller
@RequestMapping(value = "/Platform/ApplicationType")
public class ApplicationTypeController {

    private static final Logger logger = LoggerFactory.getLogger(ApplicationTypeController.class);

    @Reference(interfaceClass = IApplicationTypeService.class)
    private IApplicationTypeService applicationTypeService;

    /**
     * 
     * @Title: queryApplicationTypeList 
     * @Description: 查询应用类型信息
     * @param anFlag  是否查询条数   0 不查询条数   1 查询当前应用类型下面的条数
     * @param anBusinStatus  查询的应用机构的状态 状态 1未生效 2已生效 9已失效
     * @param request
     * @return TODO(说明)
     * @throws 
     * @author xuyp
     * @date 2017年11月15日 下午5:04:28
     */
    @RequestMapping(value = "/queryApplicationTypeList", method = RequestMethod.POST)
    public @ResponseBody String queryApplicationTypeList(final HttpServletRequest request, String flag,
            String businStatus) {
        final Map<String, Object> anMap = Servlets.getParametersStartingWith(request, "");
        logger.info("入参：" + anMap);
        return ControllerExceptionHandler.exec(new ExceptionHandler() {
            @Override
            public String handle() {
                return applicationTypeService.webQueryApplicationTypeList(flag, businStatus);
            }
        }, "操作失败", logger);
    }

}
